package gxb.test14;

import java.util.Scanner;

public class Encryption {
    public static void main(String[] args) {
        Code code = new Code();
        Scanner sc = new Scanner(System.in);
        int anInt = sc.nextInt();
        if (anInt>0) {
            code.enCode(anInt);
        }else {
            System.out.println("密码小于0");
        }

    }
}
class Code{
    public void enCode(int code){
        int qw,bw,sw,gw;
        qw=code/1000;
        bw=code%1000/100;
        sw=code/10%10;
        gw=code%10;
        // System.out.println(qw+"@"+bw+"@"+sw+"@"+gw);
        int firstCode= (qw+5)%10*1000+(bw+5)%10*100+(sw+5)%10*10+(gw+5)%10;
        // System.out.println(firstCode);
        qw=firstCode/1000;
        bw=firstCode%1000/100;
        sw=firstCode/10%10;
        gw=firstCode%10;
        int nextCode=gw*1000+sw*100+bw*10+qw;
        System.out.println(code+"加密后的结果是"+nextCode);
    }
}

